<form class="layui-form " action="" lay-filter="dataForm">
    <input type="hidden" name="id">
    <div class="layui-form-item">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" lay-verify="required" autocomplete="off" placeholder="请输入用户名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">加价总比</label>
        <div class="layui-input-inline">
            <input type="text" name="raise_price" id="raisePrice" lay-verify="required" placeholder="请输入小数" autocomplete="off" class="layui-input">
        </div>
        <div class="layui-form-mid layui-word-aux">%</div>
    </div>
    <table class="layui-table">
        <thead>
            <tr>
                <th></th>
                {volist name="type" id="vo"}
                <th style="min-width: 75px;">{$vo.name}</th>
                {/volist}
            </tr>
        </thead>
        <tbody>

            {volist name="brand" id="vo"}
            <tr>
                <td>{$vo.name}</td>
                {volist name="type" id="v"}
                <td>
                    <input name="raise_price_list[{$vo.id}][{$v.id}]" class="layui-input raisePriceList" style="width:60px;display:inline-block;"
                        value="{$info.raise_price_list[$vo.id][$v.id]}">%
                </td>
                {/volist}
            </tr>
            {/volist}
        </tbody>
    </table>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit="" lay-filter="dataSubmit">保存</button>
        </div>
    </div>
</form>
<script>
    layui.use(['form', 'http'], function () {
        var form = layui.form;
        var http = layui.http;
        var $ = layui.$;
        //表单初始赋值
        form.val('dataForm', {
            "id": "{$info.id}",
            "name": "{$info.name}",
            "raise_price": "{$info.raise_price}",
        })
        //监听提交
        form.on('submit(dataSubmit)', function (data) {
            http.post('/setting/gangtypeedit', data.field, function (res) {
                if (res.code == 0) {
                    parent.layui.table.reload('dataTable');
                    parent.layer.closeAll('page');
                }
            }, $(this))
            return false;
        })
        $("#raisePrice").on('blur',function() {
            $(".raisePriceList").val($(this).val())
        })
    });;
</script>